<script>
export default {
  name: 'CasLogin',
  data() {
    return {
      loginForm: {
        lt: '',
        execution: '',
        _eventId: 'submit',
        customerCode: '2_55',
        accountTypeCode: '1_01',
        username: '',
        password: ''
      },
      action: 'https://cas.cztvu.com?service=https%3A%2F%2Fportal.cztvu.com%2Fcas%3Fredirect%3D%2Fuc%2Fmobile',
      openId: ''
    }
  },
  created() {
    this.initData()
  },
  methods: {
    initData() {
      window.open('/uc/mobile', '_self')
      /* this.openId = this.$route.query.openid === undefined ? '' : this.$route.query.openid
      if (this.openId === '') {
        // 尝试从cookie 中获取
        this.openId = Cookies.get('openId')
      }
      if (this.openId !== '') {
        requestGet('rest/api/user/v2/info/openid', {
          openid: this.openId,
          type: appType
        }).then((res) => {
          const { data } = res
          this.loginForm.password = data.data.pwd
          this.loginForm.username = data.data.userid
          this.loginForm.execution = data.execution
          this.action = data.service
          this.$nextTick(() => {
            this.$refs.form.submit()
          })
        })
      }*/
    }
  }
}
</script>

<template>
  <div v-loading="true" class="custom-body">
    <!--    <form id="content" ref="form" method="post" class="custom-form" :action="action">
      <input name="lt" type="hidden" :value="loginForm.lt">
      <input name="execution" type="hidden" :value="loginForm.execution">
      <input name="_eventId" type="hidden" :value="loginForm._eventId">
      <input name="customerCode" type="hidden" :value="loginForm.customerCode">
      <input name="accountTypeCode" type="hidden" :value="loginForm.accountTypeCode">
      <input name="username" type="hidden" :value="loginForm.username">
      <input name="password" type="hidden" :value="loginForm.password">
    </form>-->
  </div>
</template>

<style scoped>
.custom-body {
  width: 100%;
  height: 100%;
  margin: 0 auto;
}

.custom-form {
  display: none;
}
</style>
